﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Account/SiteAccount.master" AutoEventWireup="true" CodeFile="Service.aspx.cs" Inherits="Account_Service" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <title>Dịch Vụ</title>
    <script type="text/javascript">
        function SelectAllCheckboxes(spanChk) {
            var oItem = spanChk.children;
            var theBox = (spanChk.type == "checkbox") ?
             spanChk : spanChk.children.item[0];
            xState = theBox.checked;
            elm = theBox.form.elements;
            for (i = 0; i < elm.length; i++)
                if (elm[i].type == "checkbox" &&
              elm[i].id != theBox.id) {
                    if (elm[i].checked != xState)
                        elm[i].click();
                }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    
    <asp:GridView ID="gvServices" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CssClass="ListTable" Width="100%" 
        DataKeyNames="S_ID" onpageindexchanging="gvServices_PageIndexChanging" 
        onrowcommand="gvServices_RowCommand">
        <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox runat="server" id="cbSelect"/>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" 
                            runat="server" type="checkbox" />
                    </HeaderTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <%# Container.DataItemIndex +1 %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên Dịch Vụ">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="name" Text='<%# Eval("S_Name") %>' CommandName="Detail" CommandArgument='<%#Eval("S_ID") %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mô Tả Dịch Vụ">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="desc" Text='<%# Eval("S_Description") %>' CommandName="Detail" CommandArgument='<%#Eval("S_ID") %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Trạng Thái">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="status" Text='<%# Eval("Status").ToString().Equals("True") ? " Đang Hoạt Động " : " Ngừng Hoạt Động " %>' ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div align="right">
        
        <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" 
            Text="Thêm Mới Dịch Vụ" />
        <asp:Button ID="btnStatus" runat="server" Text="Hoạt Động/Ngừng Hoạt Động" 
            onclick="btnStatus_Click" />
        
    </div>
</asp:Content>

